package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.service.BookService;

/**
 * @author: dh
 * @date: 2023-10-21 11:29
 * 业务层接口BookService的实现类.
 */
public class BookServiceImpl implements BookService {

    /**
     * 1.删除业务层中使用new的方式创建的dao对象
     */
    // private BookDao bookDao = new BookDaoImpl();

    private BookDao bookDao;

    @Override
    public void save() {

        System.out.println("book service save ...");
        bookDao.save();
    }

    /**
     * 2.在业务层提供BookDao的setter方法.
     * @param bookDao
     */
    public void setBookDao(BookDao bookDao) {

        this.bookDao = bookDao;
    }
}
